package com.lb.controller;

import com.lb.comment.Result;
import com.lb.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping
public class BuyStockController {
@Autowired
StockService stockService;
    @PostMapping("/buy")
    public Result Buy(@RequestBody Map<String, Object> params) {

        return stockService.checkStock(params.get("product_code").toString());
     //  return productCode;
    }
}
